const Mock = require('mockjs')
const Urllink = '/mock/';
// 商品列表
const product = Mock.mock({
    'data|20': [{
      'id|+1':1,
      name:"admin",
      username: '@cname',
      images:"@image('200x100', '#00405d', '#fff', 'Mock.js')",
      Price:"@float(60, 100, 3, 5)",
      remarks:'@cparagraph(1,2)',
      datatime:"@date('yyyy-MM-dd HH:mm:ss ')",
    }]
  })
  const addproduct = Mock.mock({
    'data': [{
    }]
  })

  // 管理员列表
const adminlist = Mock.mock({
  'items|20': [{
    'id|+1':1,
    title: '@cparagraph(1, 2)',
    'roles|1': ['admin', 'editor','visitor'],
    'author':'@cname',
    'passwd|1':['adminpasswd', 'editorpasswd', 'visitorpasswd '],
  }]
})


  // 导出
module.exports = [
      //获取用户菜单结合
   {
    url: Urllink+`product`,
    type: 'post',
    response: ( ) => {
      return {
        code: 1,
        data:product
      }
    }
  },
    //获取管理员列表
    {
      url: Urllink+`adminlist`,
      type: 'post',
      response: () => {
        return {
          code: 1,
          data:adminlist
        }
      }
    },
  {
    url: Urllink+`addproduct`,
    type: 'post',
    response: () => {
      return {
        code: 1,
        data:addproduct
      }
    }
  },
]